package net.csdn.business.common.domain.kanban.request;

import lombok.Data;
import lombok.experimental.SuperBuilder;
import net.csdn.business.common.enums.ActionSyncKanban;
import net.csdn.business.common.enums.BusinessTypeEnums;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @ClassName IssueLinkKanbanUpdateParam
 * @Description TODO
 * @Author liuzhisheng
 * @Date 2023/10/30
 **/
@Data
@SuperBuilder
public class IssueLinkKanbanUpdateParam {
    @NotNull
    private Integer businessType;

    @NotNull
    private List<String> businessIds;

    @NotBlank
    private String fieldId;

    private String fieldValue;

    private ActionSyncKanban action;

    public static IssueLinkKanbanUpdateParam build(List<String> businessIds, String fieldId, String fieldValue, ActionSyncKanban action) {
        return IssueLinkKanbanUpdateParam.builder()
                .businessType(BusinessTypeEnums.ISSUE.getCode())
                .businessIds(businessIds).fieldId(fieldId)
                .fieldValue(fieldValue).action(action).build();
    }
}
